﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;

namespace Gnosis.SQLite.Columns
{
    public class IntegerColumn
        : ColumnDefinition
    {
        public IntegerColumn(ColumnName name)
            : base(name, TypeName.Integer, new List<IColumnConstraint>())
        {
        }

        public IntegerColumn CollateBinary
        {
            get 
            {
                AddChild(ColumnCollate.Binary());
                return this;
            }
        }

        public IntegerColumn CollateCaseInsensitive
        {
            get
            {
                AddChild(ColumnCollate.CaseInsensitive());
                return this;
            }
        }

        public IntegerColumn CollateRightTrim
        {
            get
            {
                AddChild(ColumnCollate.RightTrim());
                return this;
            }
        }

        public IntegerColumn NotNull
        {
            get
            {
                AddChild(new ColumnNotNull());
                return this;
            }
        }

        public IntegerColumn PrimaryKey
        {
            get
            {
                AddChild(ColumnPrimaryKey.Ascending());
                return this;
            }
        }

        public IntegerColumn PrimaryKeyAutoIncrement
        {
            get
            {
                AddChild(ColumnPrimaryKey.AscendingAutoIncrement());
                return this;
            }
        }

        public IntegerColumn PrimaryKeyDescending
        {
            get
            {
                AddChild(ColumnPrimaryKey.Descending());
                return this;
            }
        }

        public IntegerColumn Default(IInteger value)
        {
            AddChild(new ColumnDefault(value));
            return this;
        }
    }
}
